package com.zgkj.Zip.service;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.zgkj.Zip.unzip;
import com.zgkj.Zip.form.AgentInfo;
import com.zgkj.Zip.form.Biannualfeeconftb;
import com.zgkj.Zip.form.Feeinfoall;
import com.zgkj.Zip.form.NoticeInfo;
import com.zgkj.Zip.form.NoticeListInf;
import com.zgkj.Zip.tools.DBUtil;
import com.zgkj.Zip.tools.DateUtil;
import com.zgkj.Zip.tools.SqlUtil;
import com.zgkj.Zip.tools.StringUtil;

public class InsetDbService {

	//private static String unintid = "01";// 金通

	private static String unintid = unzip.unitid;

	public boolean  instert(NoticeInfo NoticeInfo,NoticeListInf NoticeListInf) throws ParseException {
		DBUtil db = null;
		try {
			db = new DBUtil();
			String  examinername = "";
			String  department = "";
			String  phone = "";
			String deadlineDate = "";
			ArrayList<String> sqlList = new ArrayList<String>();

			String dmhflag = NoticeListInf.getDmhflag();
			boolean isyzBoolean = false;
			if(StringUtil.isEmpt(dmhflag)){
				isyzBoolean =  true;
				NoticeListInf.setTongzhismc(NoticeListInf.getTongzhismc()+"(印章)");
				NoticeListInf.setFawenxlh(NoticeListInf.getFawenxlh()+"A");
				NoticeListInf.setTongzhisid(NoticeListInf.getTongzhisid()+"CA");
			}
			String qryString = "select count(1) from BICPCFLOWTB where FAWENXLH = '"+NoticeListInf.getFawenxlh()+"'";
			unzip.log(qryString);
			int count = db.getNumber(qryString);
			if(count!=0){
				unzip.log(NoticeListInf.getFawenxlh()+":该案子不能重复处理！");
				return true;
			}
			//**************查找案件**********************
			String neibuh = NoticeListInf.getNeibubh();
			String shengqingh = NoticeListInf.getShenqingh();
			StringBuffer whereBuffer =  new StringBuffer(" where");
			if(unintid!=""){
				whereBuffer.append(" unitid= '").append(unintid).append("' and ");
			}
			unzip.log(NoticeListInf.getTongzhisbm());
			if("200101".equals(NoticeListInf.getTongzhisbm())){ //只有受理通知书才是以内部号为条件
				whereBuffer.append("  (caseid= '").append(neibuh).append("'");
				whereBuffer.append(" or licenseno = '").append(shengqingh).append("' )");
			}else{
				whereBuffer.append(" (licenseno = '").append(shengqingh).append("' )");
			}
			//**************查找案件 end**********************

			String qryString2 = "select * from BIFLOWBEFTB t "+whereBuffer.toString() ;
			unzip.log(qryString2);
			HashMap biflowbeftbMap = db.getRecord(qryString2);
			if(biflowbeftbMap==null){
				unzip.log("未找到该专利");
				return false;
			}
			String caseid = (String) biflowbeftbMap.get("caseid");
			boolean isqueryBoolean = true;

			String licenseno = NoticeListInf.getShenqingh();
			String type = licenseno.substring(4, 5); //第五位代表专利类型
			if("8".equals(type)){
				type="1";
			}
			if("9".equals(type)){
				type="2";
			}
			if(isyzBoolean){
				String insertSqlString = "insert into BICPCFLOWTB (SHENQINGH,CASEID, FAWENR, TONGZHISMC, " +
				"TONGZHISBM, ENDDATE, TONGZHISID, FAWENXLH,EXAMINERNAME, DEPARTMENT, PHONE,INSTDATE,INSTTIME,ISNEEDUPLOAD,UNITID) " +
				"values (" +
				"'"+(NoticeListInf.getShenqingh()==null?"":NoticeListInf.getShenqingh())+"',"+
				"'"+caseid+"',"+
				"'"+(NoticeListInf.getFawenr()==null?"":NoticeListInf.getFawenr())+"',"+
				"'"+(NoticeListInf.getTongzhismc()==null?"":NoticeListInf.getTongzhismc())+"',"+
				"'"+(NoticeListInf.getTongzhisbm()==null?"":NoticeListInf.getTongzhisbm())+"',"+
				"'"+deadlineDate+"',"+
				"'"+ (NoticeListInf.getTongzhisid()==null?"":NoticeListInf.getTongzhisid())+"',"+
				"'"+ (NoticeListInf.getFawenxlh()==null?"":NoticeListInf.getFawenxlh())+"',"+
				"'"+ examinername+"',"+
				"'"+ department+"',"+
				"'"+ phone +"',"+
				"'"+DateUtil.getSystemDate()+"',"+
				"'"+DateUtil.getSystemTime()+"',"+
				"'"+"0"+"',"+
				"'"+InsetDbService.unintid+"'"
				+ ")";
				sqlList.add(insertSqlString);

				StringBuffer  updateSql_1 = new StringBuffer("update biflowbeftb set ");
				updateSql_1.append(" casename = '").append(NoticeListInf.getFamingmc()).append("' ");
				updateSql_1.append(", applydate = '").append(NoticeListInf.getShenqingr()).append("' ");
				updateSql_1.append(", licenseno = '").append(NoticeListInf.getShenqingh()).append("' ");

				updateSql_1.append(whereBuffer);
				sqlList.add(updateSql_1.toString());

				db.addBatch(sqlList);
				db.executeBatch();
				unzip.log("处理完成……");
				return true;
			}

			if(NoticeInfo!=null){
				List<Feeinfoall> aList = NoticeInfo.getFee_info_all();
				if(aList.size()>0){
					isqueryBoolean = false;
					for (Feeinfoall Feeinfoall : aList) {
						if(Feeinfoall.getFee_amount()==null){
							continue;
						}
						String amt = SqlUtil.getIntStr(Feeinfoall.getFee_amount()) ;
						if(amt.equals("0")){
							continue;
						}
						String feenameString = Feeinfoall.getFee_name();
						if("年费".equals(feenameString)){ //如果是年费 变更年费名称
							feenameString = "第"+NoticeInfo.getAnnual_year()+"年年费";
						}
						HashMap<String, String> aHashMap= new HashMap<>();
						aHashMap.put("caseid", caseid);
						aHashMap.put("feename", feenameString);
						aHashMap.put("feeamt", amt);
						aHashMap.put("enddate", NoticeInfo.getPay_deadline_date());
						aHashMap.put("shenqingh", NoticeListInf.getShenqingh()==null?"":NoticeListInf.getShenqingh());
						aHashMap.put("instdate", DateUtil.getSystemDate());
						aHashMap.put("insttime", DateUtil.getSystemTime());
						aHashMap.put("feeid", DateUtil.getSystemMicroTime()+StringUtil.getRandomByNum(6));
						aHashMap.put("fawenxlh", NoticeListInf.getFawenxlh());
						sqlList.add(SqlUtil.getInsetSql("BICWINFTB", aHashMap));
					}
					if("200602".equals(NoticeListInf.getTongzhisbm())){ //如果是办登
						String licensedate = NoticeListInf.getFawenr(); //受理通知书的发文日就是授权日
						String casetype =  (String)biflowbeftbMap.get("casetype");
//						StringBuffer updateSql = new StringBuffer("update biflowbeftb set ");
//						updateSql.append(" licensedate = '").append(licensedate).append("' ");
//						updateSql.append(whereBuffer);
//						sqlList.add(updateSql.toString());
						String custid =  (String) biflowbeftbMap.get("custid");
						HashMap<String, String> bicustomerinfMap = db.getRecord("select * from bicustomerinf t where t.custid='"+custid+"'");


						String bdfeeString = bicustomerinfMap.get("bdfee");
						if(bdfeeString == null){
							bdfeeString = "10000"; //默认一百
						}
						HashMap<String, String> aHashMap1= new HashMap<>();
						aHashMap1.put("caseid", caseid);
						aHashMap1.put("feename", "办登代理费");
						aHashMap1.put("feeamt", 0+"");
						aHashMap1.put("fee", bdfeeString);
						aHashMap1.put("enddate", NoticeInfo.getPay_deadline_date());
						aHashMap1.put("shenqingh", NoticeListInf.getShenqingh()==null?"":NoticeListInf.getShenqingh());
						aHashMap1.put("instdate", DateUtil.getSystemDate());
						aHashMap1.put("insttime", DateUtil.getSystemTime());
						aHashMap1.put("feeid", DateUtil.getSystemMicroTime()+StringUtil.getRandomByNum(6));
						aHashMap1.put("fawenxlh", NoticeListInf.getFawenxlh());
						aHashMap1.put("feetype", "1"); //代理费
						sqlList.add(SqlUtil.getInsetSql("BICWINFTB", aHashMap1));

//						HashMap<String, String> aHashMap2= new HashMap<String, String>();
//						aHashMap2.put("caseid", caseid);
//						aHashMap2.put("feename", "公告印刷费");
//						aHashMap2.put("feeamt", "5000");
//						aHashMap2.put("enddate", NoticeInfo.getPay_deadline_date());
//						aHashMap2.put("shenqingh", NoticeListInf.getShenqingh()==null?"":NoticeListInf.getShenqingh());
//						aHashMap2.put("instdate", DateUtil.getSystemDate());
//						aHashMap2.put("insttime", DateUtil.getSystemTime());
//						aHashMap2.put("feeid", DateUtil.getSystemMicroTime()+StringUtil.getRandomByNum(6));
//						aHashMap2.put("fawenxlh", NoticeListInf.getFawenxlh());
//						aHashMap2.put("feetype", "0");
//						sqlList.add(SqlUtil.getInsetSql("BICWINFTB", aHashMap2));
						String szdlfee = (String)biflowbeftbMap.get("szdlfee");
						if("1".equals(casetype)&&!"0".equals(szdlfee)){ //如果是发明 新增一条实审代理费
							HashMap<String, String> aHashMap3= new HashMap<>();
							aHashMap3.put("caseid", caseid);
							aHashMap3.put("feename", "实审代理费");
							aHashMap3.put("fee", szdlfee);
							aHashMap3.put("feeamt", "0");
							aHashMap3.put("enddate", "");
							aHashMap3.put("shenqingh", NoticeListInf.getShenqingh()==null?"":NoticeListInf.getShenqingh());
							aHashMap3.put("instdate", DateUtil.getSystemDate());
							aHashMap3.put("insttime", DateUtil.getSystemTime());
							aHashMap3.put("feeid", DateUtil.getSystemMicroTime()+StringUtil.getRandomByNum(6));
							aHashMap3.put("fawenxlh", NoticeListInf.getFawenxlh());
							aHashMap3.put("feetype", "0");
							sqlList.add(SqlUtil.getInsetSql("BICWINFTB", aHashMap3));
						}


						String qryString3 = "select t.casetype||'_'||t.yearnum as id,t.* from biannualfeeconftb t";
						unzip.log(qryString3);
						HashMap[] biannualfeeconftbs = db.getRecordHashMapArray(qryString3);
						HashMap<String, Biannualfeeconftb> biannualfeeconftbMap = new HashMap<>();
						for (HashMap biannualfeeconftb2 : biannualfeeconftbs) {
							Biannualfeeconftb Biannualfeeconftb = new Biannualfeeconftb();
							Biannualfeeconftb.setFeeid((String)biannualfeeconftb2.get("feeid"));
							Biannualfeeconftb.setFullamt(Integer.parseInt((String)biannualfeeconftb2.get("fullamt")));
							Biannualfeeconftb.setSelflostamt(Integer.parseInt((String)biannualfeeconftb2.get("selflostamt")));
							Biannualfeeconftb.setBusilostamt(Integer.parseInt((String)biannualfeeconftb2.get("busilostamt")));
							biannualfeeconftbMap.put((String)biannualfeeconftb2.get("id"), Biannualfeeconftb);
						}
						String annual_year = (Integer.parseInt(NoticeInfo.getAnnual_year())+1)+""; //总年费年份
						String numString = "2";  //默认第二年

						String idString = casetype+"_"+annual_year;
						Biannualfeeconftb  biannualfeeconftb_temp = biannualfeeconftbMap.get(idString);
						//String custid =  (String) biflowbeftbMap.get("custid");
						String fee = (bicustomerinfMap.get("fee") == null) ? "0" : (String)bicustomerinfMap.get("fee");

						String applytype = "0";
							String cost_slow_flag = NoticeInfo.getCost_slow_flag();
							if(cost_slow_flag.startsWith("85")){
								applytype = "1";
							}else if(cost_slow_flag.startsWith("70")){
								applytype = "2";
							}else{
								applytype = "0";
							}
						while (biannualfeeconftb_temp!=null) {
							int txnamt = 0;
							if("1".equals(applytype)&&Integer.parseInt(numString)<11){
								txnamt = biannualfeeconftb_temp.getSelflostamt();
							}else if("2".equals(applytype)&&Integer.parseInt(numString)<11){
								txnamt = biannualfeeconftb_temp.getBusilostamt();
							}else{
								txnamt = biannualfeeconftb_temp.getFullamt();
							}
							String startdateString = DateUtil.getNextYear(NoticeListInf.getShenqingr(), Integer.parseInt(annual_year) - 1);
							String enddateString = DateUtil.getNextY(startdateString);
							HashMap<String, String> aHashMap= new HashMap<>();
							aHashMap.put("caseid", caseid);
							aHashMap.put("unitid", (String) biflowbeftbMap.get("unitid"));
							aHashMap.put("custid", custid);
							aHashMap.put("lastupdatetime", DateUtil.getSystemCurrentDateTime());
							aHashMap.put("casetype", (String) biflowbeftbMap.get("casetype"));
							aHashMap.put("adddate", DateUtil.getSystemDate());
							aHashMap.put("addtime", DateUtil.getSystemTime());
							aHashMap.put("applytype", applytype);
							aHashMap.put("txnamt", txnamt+"");
							aHashMap.put("fullamt", biannualfeeconftb_temp.getFullamt()+"");
							aHashMap.put("num%", numString);
							aHashMap.put("totalnum%", annual_year);
							aHashMap.put("feetype", "0");
							aHashMap.put("feeid", biannualfeeconftb_temp.getFeeid());
							aHashMap.put("caseid", caseid);
							aHashMap.put("fee", fee);
							aHashMap.put("startdate", startdateString);
							aHashMap.put("enddate", enddateString);
							aHashMap.put("orderid%", "orderidseq1.nextval");
							sqlList.add(SqlUtil.getInsetSql("bifeedetailtb", aHashMap));
							numString = (Integer.parseInt(numString)+1)+"";
							annual_year = (Integer.parseInt(annual_year)+1)+"";
						    idString = casetype+"_"+annual_year;
						    biannualfeeconftb_temp = biannualfeeconftbMap.get(idString);
						    if(casetype.equals("3")){ //如果是外观
								if(NoticeListInf.getShenqingr().compareTo("20210601")<0){
									if(Integer.parseInt(annual_year)>10){
										break;
									}
								}
							}
						}
			            StringBuffer updateSql = new StringBuffer("update biflowbeftb set ");
			            updateSql.append(" applytype = '").append(applytype).append("' ");
			            updateSql.append(whereBuffer);
			            sqlList.add(updateSql.toString());
					}else if("200021".equals(NoticeListInf.getTongzhisbm())){ //费减通知书
						String Cost_slow_rate_annul  = NoticeInfo.getCost_slow_rate_annul();
						String applytype = "0";
						int feeamt = 2500*100;
						if(Cost_slow_rate_annul!=null){
							if(Cost_slow_rate_annul.startsWith("85")){
								applytype = "1";
								feeamt = (int) (feeamt*0.15);
							}else if(Cost_slow_rate_annul.startsWith("70")){
								applytype = "2";
								feeamt = (int) (feeamt*0.3);
							}
						}
						if("0".equals(applytype)){ //如果不费减 异常 不处理
							return false;
						}else{
							StringBuffer updateSql = new StringBuffer("update biflowbeftb set ");
							updateSql.append(" applytype = '").append(applytype).append("' ");
							updateSql.append(whereBuffer);
							sqlList.add(updateSql.toString());
						}
						if("1".equals(type)){ //发明专利
							HashMap<String, String> aHashMap1= new HashMap<>();
							aHashMap1.put("caseid", caseid);
							aHashMap1.put("feename", "发明专利申请实质审查费");
							aHashMap1.put("feeamt", feeamt+"");
							aHashMap1.put("enddate", DateUtil.getNextMD(NoticeListInf.getShenqingr(), 0,36)); //申请日的三年三年
							aHashMap1.put("shenqingh", NoticeListInf.getShenqingh()==null?"":NoticeListInf.getShenqingh());
							aHashMap1.put("instdate", DateUtil.getSystemDate());
							aHashMap1.put("insttime", DateUtil.getSystemTime());
							aHashMap1.put("feeid", DateUtil.getSystemMicroTime()+StringUtil.getRandomByNum(6));
							aHashMap1.put("fawenxlh", NoticeListInf.getFawenxlh());
							sqlList.add(SqlUtil.getInsetSql("BICWINFTB", aHashMap1));
						}

					} else if("200103".equals(NoticeListInf.getTongzhisbm())){//缴纳申请费通知书
						StringBuffer updateSql = new StringBuffer("update biflowbeftb set "); //不费减
						updateSql.append(" applytype = '").append("0").append("' ");
						updateSql.append(whereBuffer);
						sqlList.add(updateSql.toString());


						if("1".equals(type)){ //发明专利
							HashMap<String, String> aHashMap1= new HashMap<>();
							aHashMap1.put("caseid", caseid);
							aHashMap1.put("feename", "发明专利申请实质审查费");
							aHashMap1.put("feeamt", "250000");
							aHashMap1.put("enddate", DateUtil.getNextMD(NoticeListInf.getShenqingr(), 0,36)); //申请日的三年三年
							aHashMap1.put("shenqingh", NoticeListInf.getShenqingh()==null?"":NoticeListInf.getShenqingh());
							aHashMap1.put("instdate", DateUtil.getSystemDate());
							aHashMap1.put("insttime", DateUtil.getSystemTime());
							aHashMap1.put("feeid", DateUtil.getSystemMicroTime()+StringUtil.getRandomByNum(6));
							aHashMap1.put("fawenxlh", NoticeListInf.getFawenxlh());
							sqlList.add(SqlUtil.getInsetSql("BICWINFTB", aHashMap1));
						}
					}else if("200702".equals(NoticeListInf.getTongzhisbm())){  //结案通知书
						String fawenr = NoticeListInf.getFawenr();
						String startdate = DateUtil.getNextYear(fawenr,-1);
						String getSql = " select * from biflowbeftb t  left join  bifeedetailtb b on t.caseid=b.caseid  where t.caseid ='$:0' and  b.enddate between $:1 and $:2";
						getSql = getSql.replace("$:0", caseid);
						getSql = getSql.replace("$:1", startdate);
						getSql = getSql.replace("$:2", fawenr);
						HashMap getDbMap = db.getRecord(getSql);
						String casestat = "9";  //结案
						if(getDbMap == null||!"3".equals(getDbMap.get("custstate"))){
							 casestat = "8";
						}
						String updateSql = "update biflowbeftb t set t.flowstate = '"+casestat+"' " + whereBuffer;
						sqlList.add(updateSql);
					}
					deadlineDate = NoticeInfo.getPay_deadline_date()==null?"": NoticeInfo.getPay_deadline_date();
					examinername = NoticeInfo.getExaminer_name();
					department = NoticeInfo.getDepartment();
			}
			}
			String ishasreturn = "0";
			String flowstate =null;
			if(true){
				//if(isqueryBoolean){
				String qryString1 = "select * from bitxntypetb t  where txntype = '"+NoticeListInf.getTongzhisbm()+"'";
				HashMap queryMap = db.getRecord(qryString1);
				String fawenr = NoticeListInf.getFawenr();
				if(queryMap!=null){
					if("1".equals(queryMap.get("ishasdel"))){
						deadlineDate = DateUtil.getNextDM(fawenr, Integer.parseInt((String)queryMap.get("enddays")), Integer.parseInt((String)queryMap.get("endmoths")));
					}else{
						deadlineDate = "";
					}
					ishasreturn = (String) queryMap.get("ishasreturn");
					if(ishasreturn==null){
						ishasreturn="0";
					}
					flowstate = (String) queryMap.get("updatestate");
				}
			}
			String insertSqlString = "insert into BICPCFLOWTB (SHENQINGH,CASEID, FAWENR, TONGZHISMC, " +
			"TONGZHISBM, ENDDATE, TONGZHISID, FAWENXLH,EXAMINERNAME, DEPARTMENT, PHONE,INSTDATE,INSTTIME,ISNEEDUPLOAD,UNITID) " +
			"values (" +
			"'"+(NoticeListInf.getShenqingh()==null?"":NoticeListInf.getShenqingh())+"',"+
			"'"+caseid+"',"+
			"'"+(NoticeListInf.getFawenr()==null?"":NoticeListInf.getFawenr())+"',"+
			"'"+(NoticeListInf.getTongzhismc()==null?"":NoticeListInf.getTongzhismc())+"',"+
			"'"+(NoticeListInf.getTongzhisbm()==null?"":NoticeListInf.getTongzhisbm())+"',"+
			"'"+deadlineDate+"',"+
			"'"+ (NoticeListInf.getTongzhisid()==null?"":NoticeListInf.getTongzhisid())+"',"+
			"'"+ (NoticeListInf.getFawenxlh()==null?"":NoticeListInf.getFawenxlh())+"',"+
			"'"+ examinername+"',"+
			"'"+ department+"',"+
			"'"+ phone +"',"+
			"'"+DateUtil.getSystemDate()+"',"+
			"'"+DateUtil.getSystemTime()+"',"+
			"'"+ishasreturn+"',"+
			"'"+InsetDbService.unintid+"'"
			+ ")";
			sqlList.add(insertSqlString);
//			if(NoticeInfo!=null&&NoticeInfo.getCost_slow_rate_annul()!=null){
//				String Cost_slow_rate_annul  = NoticeInfo.getCost_slow_rate_annul();
//				String applytype = "0";
//
//				if(Cost_slow_rate_annul.startsWith("85")){
//					applytype = "1";
//				}else if(Cost_slow_rate_annul.startsWith("70")){
//					applytype = "2";
//				}
//				StringBuffer updateSql = new StringBuffer("update biflowbeftb set ");
//				updateSql.append(" applytype = '").append(applytype).append("' ");
//				updateSql.append(whereBuffer);
//				sqlList.add(updateSql.toString());
//			}
//
			if(biflowbeftbMap==null){
				return false;
			}

			String isupdateflag1 = (String) biflowbeftbMap.get("isupdateflag1");
			String isupdateflag2 = (String) biflowbeftbMap.get("isupdateflag2");
		    StringBuffer updateSql;
		    if (flowstate != null) {
		        updateSql = new StringBuffer("update biflowbeftb set ");
		        updateSql.append(" flowstate = '").append(flowstate).append("'");
		        updateSql.append(whereBuffer);
		        sqlList.add(updateSql.toString());
		    }
				if(!"1".equals(isupdateflag1)){
				    updateSql = new StringBuffer("update biflowbeftb set ");
					updateSql.append(" casename = '").append(NoticeListInf.getFamingmc().replace("'", "''")).append("' ");
					updateSql.append(", licenseno = '").append(NoticeListInf.getShenqingh()).append("' ");
					//updateSql.append(", applydate = '").append(NoticeListInf.getShenqingr()).append("' ");
					//updateSql.append(", applydate = '").append(NoticeListInf.getShenqingr()).append("' ");
					updateSql.append(", isupdateflag1 = '1'");
					updateSql.append(", casetype = '").append(type).append("'");

					updateSql.append(whereBuffer);
					sqlList.add(updateSql.toString());
				}

				if(!"1".equals(isupdateflag2)){
					if(NoticeInfo!=null)
					{
						String agent1 = "";
						String agent2 = "";
						for (AgentInfo AgentInfo : NoticeInfo.getPatent_agency().getAgent_info()) {
							if(AgentInfo.getSeq()==1){
								agent1 = AgentInfo.getAgent_workid()==null?"": AgentInfo.getAgent_workid();
							}
							if(AgentInfo.getSeq()==2){
								agent2 = AgentInfo.getAgent_workid()==null?"": AgentInfo.getAgent_workid();
							}
						}
						updateSql = new StringBuffer("update biflowbeftb set ");
						updateSql.append(" agent1 = '").append(agent1).append("' ");
						updateSql.append(", agent2 = '").append(agent2).append("' ");
						//updateSql.append(", zlman = '").append(NoticeInfo.getApplicant_info()).append("' ");
						updateSql.append(", isupdateflag2 = '1'");
						updateSql.append(whereBuffer);
						sqlList.add(updateSql.toString());
				}
			}

			//只要是 申请日和 专利权人不为空就更新
			String zlman = NoticeInfo ==null?null:NoticeInfo.getApplicant_info();
			String applydate= NoticeListInf.getShenqingr();
			if(zlman!=null&&zlman.length()>0){
				updateSql = new StringBuffer("update biflowbeftb set ");
				updateSql.append(" zlman = '").append(zlman).append("' ");
				updateSql.append(whereBuffer);
				sqlList.add(updateSql.toString());
			}
			if(applydate!=null&&applydate.length()>0){
				updateSql = new StringBuffer("update biflowbeftb set ");
				updateSql.append(" applydate = '").append(applydate).append("' ");
				updateSql.append(whereBuffer);
				sqlList.add(updateSql.toString());
			}
			db.addBatch(sqlList);
			db.executeBatch();
			unzip.log("处理完成……");
			return true;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			unzip.log(e.getMessage());
			e.printStackTrace();

		}finally{
			db.close();
		}
		return true;
	}

	public static void main(String[] args) {
		String aString="1.00";
		unzip.log(aString.substring(0,aString.indexOf(".")));
		unzip.log("2016305536602".substring(4,5));
	}
}
